import request from '@/utils/request'
const api_name = "/video"
export default {
    // 添加课时
    addVideo(video) {
        return request({
            url: `${api_name}`,
            method: "post",
            data: video
        })
    },
    // 根据id获取课时信息
    getVideoByid(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    // 更新课时
    updateVideo(video) {
        return request({
            url: `${api_name}/${video.id}`,
            method: 'put',
            data: video
        })
    },
    // 删除课时信息
    deleteById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    }
}